We give a method for constructing a Legendrian representative of a knot in $S^3$ which realizes its maximal Thurston-Bennequin number under a certain condition. The method utilizes Stein handle decompositions of $D^4$, and the resulting Legendrian representative is often very complicated (relative to the complexity of the topological knot type). As an application, we construct infinitely many knots in $S^3$ each of which yields a reducible 3-manifold by a Legendrian surgery in the standard tight contact structure. This disproves a conjecture of Lidman and Sivek.
17 pages, 20 figures, minor corrections, to appear in Compositio Mathematica